#include <iostream>
#include <string.h>
using namespace std;

const int N = 110;
int hats[N], guess[N];
int n, m, flag, all_zero;

int main()
{
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> hats[i];
    }
    cin >> m;
    while (m--)
    {
        memset(guess, 0, sizeof(guess));
        flag = 0;
        all_zero = 1;
        for (int i = 0; i < n; i++)
        {
            cin >> guess[i];
            if (guess[i])
            {
                all_zero = 0;
                if (guess[i] != hats[i])
                {
                    flag = 1;
                }
            }
        }
        if (all_zero || flag)
        {
            cout << "Ai Ya" << endl;
        }
        else
        {
            cout << "Da Jiang!!!" << endl;
        }
    }
    return 0;
}